<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增用料采购申请')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-requisition-add"  th:object="${pId}">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">材料类型：</label>
                <div class="col-sm-8">
                    <input name="mName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">材料数量：</label>
                <div class="col-sm-8">
                    <input name="mNum" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group" style="display: none">
                <label class="col-sm-3 control-label is-required">申请人：</label>
                <div class="col-sm-8">
                    <input name="mApplicant" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">创建时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input id="mTime" name="mTime"  class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group" style="display: none">
                <label class="col-sm-3 control-label is-required">审批状态：</label>
                <div class="col-sm-8">
                    <select id="mStatus" name="mStatus" th:with="type=${@dict.getType('mate_status')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
                    </select>
                </div>
            </div>
            <div class="form-group" style="display: none">
                <label class="col-sm-3 control-label">项目外键：</label>
                <div class="col-sm-8">
                    <input id="mId" name="mId" class="form-control" type="text" th:value="${pId}">
                </div>
            </div>
            <div class="form-group" style="display: none">
                <label class="col-sm-3 control-label">审批意见：</label>
                <div class="col-sm-8">
                    <input id="mOpinion" name="mOpinion" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "ruoyi/requisition"
        $("#form-requisition-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-requisition-add').serialize());
            }
        }

        $("input[name='mTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>